Ext.define('Admin.view.gooutDefend.GooutDefendViewController', {
    extend: Ext.app.ViewController,
    alias: 'controller.gooutDefendViewController',
    itemclick: function (view, recIndex, cellIndex, item, e, record) {
        var gridPanel = Ext.getCmp('gooutDefendGrid');
        Ext.Ajax.request({
            url: 'goout/Update_1',
            method: 'post',
            params: {
                id: record.data.id
            },
            async: false,
            defaultHeaders: {
                'X-CSRF-TOKEN': document.getElementsByTagName('meta')['_csrf'].content
            },
            success: function (response, options) {
                var json = Ext.util.JSON.decode(response.responseText);
                if (json.success) {
                    gridPanel.getStore().reload();
                } else {
                    Ext.Msg.alert('操作失败', json.msg);
                }

            }
        });
    }
});
